﻿using Newtonsoft.Json;
using Swashbuckle.AspNetCore.Annotations;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace Kang.Api.Dtos
{
    [JsonObject(MemberSerialization.OptIn)]
    public class TestAddDto
    {
        /// <summary>
        /// 用户信息
        /// </summary>
        [JsonObject(MemberSerialization.OptIn)]
        public class TestAddItemData
        {
            [SwaggerSchema("姓名"), Required]
            [JsonProperty("name"), JsonPropertyName("name"), DefaultValue("张三")]
            public string Name { get; set; }

            [SwaggerSchema("联系电话"), Required]
            [JsonProperty("phone"), JsonPropertyName("phone"), DefaultValue("13912341234")]
            public string Phone { get; set; }
        }

        [SwaggerSchema("加密后签名"), Required]
        [JsonProperty("sign"), DefaultValue("D43E47F67F1A1F10041A49BDBFD35983")]
        public string Sign { get; set; }

        [SwaggerSchema("Time时间戳（秒）", Format = "int64"), Required]
        [JsonProperty("t"), JsonPropertyName("t"), DefaultValue(1652953622)]
        public long? Time { get; set; }

        [SwaggerSchema("数据对象"), Required]
        [JsonProperty("data")]
        public TestAddItemData Data { get; set; }
    }
}
